package com.itheima.d09_io_print;

import java.io.File;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.nio.charset.Charset;
import java.util.Date;

/**
 * 目标：了解打印流的基本使用
 */
public class Test {

    public static void main(String[] args) {
        try(
                //PrintStream ps1 = new PrintStream("day11_io\\src\\com\\itheima\\d09_io_print\\ayu.txt");
                //PrintStream ps2 = new PrintStream(new File("day11_io\\src\\com\\itheima\\d09_io_print\\ayu.txt"));
                //PrintStream ps3 = new PrintStream(new FileOutputStream("day11_io\\src\\com\\itheima\\d09_io_print\\ayu.txt"));

                //PrintStream ps1 = new PrintStream("day11_io\\src\\com\\itheima\\d09_io_print\\ayu.txt", "GBK");
                //PrintStream ps6 = new PrintStream(new FileOutputStream("day11_io\\src\\com\\itheima\\d09_io_print\\ayu.txt"), true,"utf-8");
                PrintStream ps1 = new PrintStream(new FileOutputStream("day11_io\\src\\com\\itheima\\d09_io_print\\ayu.txt"), true);
                ){

            //打印数据
            //print 提供丰富打印功能
            ps1.println(666); //打印  + 换行
            ps1.println('男');
            ps1.println(1.68);
            ps1.println(true);
            ps1.println("张三");
            ps1.println(new Date());


            //write 保留打印字节数据的功能
            ps1.write(97);

        }catch (Exception e){

        }
    }
}
